Techniques for Constructing Efficient Lock-free Data Structures
نویسنده
چکیده
Techniques for Constructing Efficient Lock-free Data Structures Trevor Brown Doctor of Philosophy Graduate Department of Computer Science University of Toronto 2017 Building a library of concurrent data structures is an essential way to simplify the difficult task of developing concurrent software. Lock-free data structures, in which processes can help one another to complete operations, offer the following progress guarantee: If processes take infinitely many steps, then infinitely many operations are performed. Handcrafted lock-free data structures can be very efficient, but are notoriously difficult to implement. We introduce numerous tools that support the development of efficient lock-free data structures, and especially trees. We address the difficulty of using single-word compare-and-swap (CAS) to develop lock-free graph-based data structures by introducing multiword synchronization primitives called LLX and SCX. These primitives fall between multi-compare-single-swap and full multiword-CAS in expressiveness, and can be implemented much more efficiently than multiword-CAS. We use them to implement a tree update template that can be followed to produce lock-free implementations of arbitrary updates in down-trees, and use this template to produce the first lock-free implementations of several advanced trees: chromatic search trees, relaxed AVL trees, and relaxed (a,b)-trees. We also introduce a new variant of a B-tree, called a relaxed B-slack tree, which has significantly better worst-case space complexity, and produce a lock-free implementation using our template. In these implementations, operations dynamically allocate memory for nodes. Additionally, in our implementation of LLX and SCX, each SCX operation allocates a descriptor, which contains information that another process can use to help the SCX operation complete. These implementations must perform dynamic lock-free memory reclamation, but traditional lock-free memory reclamation algorithms are either inefficient or cannot be used with our implementations. So, we introduce a fast epoch-based reclamation (EBR) algorithm called DEBRA+, which is the first lock-free EBR algorithm that can be used with trees. We also devise two techniques for accelerating lock-free data structure implementations. Using the first technique, we can efficiently eliminate dynamic allocation and reclamation of descriptors in SCX, and a large class of other algorithms. Using the second, we exploit hardware transactional memory support in modern processors to produce accelerated implementations of the template.
منابع مشابه
Concurrent B-trees with Lock-free Techniques
B-trees and their variants are efficient data structures for finding records in a large collection (e.g., databases). The efficiency of B-trees increases when a number of users can manipulate the tree simultaneously. Many algorithms have been developed over the last three decades to achieve both concurrency and consistency in B-trees. However, current lock-based concurrency-control techniques l...
متن کاملArchitectural Transactional Memory: Support for Lock-Free Data Structures
A shared data structure is lock-free if its operations do not require mutual exclusion. If one process is interrupted in the middle of an operation, other processes will not be prevented from operating on that object. In highly concurrent systems, lock-free data structures avoid common problems associated with conventional locking techniques, including priority inversion, convoying, and difficu...
متن کاملOn Composability, Efficient Design and Memory Reclamation of Lock-free Data Structures
The transition to multicore processors has brought synchronization, a fundamental challenge in computer science, into focus. In looking for solutions to the problem, interest has developed in the lock-free approach, which has been proven to achieve several advantages over the traditional mutual exclusion approach. This thesis studies challenges in interprocess synchronization in shared memory m...
متن کاملLock-Free Red-Black Trees Using CAS
The negative side-effects of using lock-based synchronization mechanisms are well known and include unexpected scheduling anomalies such as priority inversion and convoying as well as unnecessary synchronization overhead and the potential for deadlock. Despite these drawbacks, the use of lock-free techniques has not gained widespread acceptance. The reasons for this lack of acceptance include t...
متن کاملPractical and Efficient Lock-Free Garbage Collection Based on Reference Counting
We present an efficient and practical lock-free implementation of a garbage collection scheme based on reference counting aimed for the use with arbitrary lock-free dynamic data structures. The scheme guarantees the safety of local as well as global references, supports arbitrary memory reuse, uses atomic primitives which are available in modern computer systems and provides an upper bound on t...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- CoRR
دوره abs/1712.05406 شماره
صفحات -
تاریخ انتشار 2017